#include "rgb_display_driver.h"
#include "cap_gt9xx.h"
#include "FreeRTOS.h"
#include "task.h"

void main_rgb_lcd(void)
{
    WHT_RGB_Display_Driver.WHT_Init();
    WHT_GT9xx_Driver.WHT_Init();

    /*背景层刷黑色 透明*/
    WHT_RGB_Display_Driver.WHT_Set_Layer(RGB_Backround_Layer);
    WHT_RGB_Display_Driver.WHT_Set_Transparency(0);
    WHT_RGB_Display_Driver.WHT_Fill_Color(0, 0, WHT_RGB_Display_Driver.WHT_Info->X_Length - 1, WHT_RGB_Display_Driver.WHT_Info->Y_Length - 1, RGB565_BLACK);
    /*把前景层刷蓝色 不透明*/
    WHT_RGB_Display_Driver.WHT_Set_Layer(RGB_Foreground_Layer);
    WHT_RGB_Display_Driver.WHT_Set_Transparency(0);
    WHT_RGB_Display_Driver.WHT_Fill_Color(0, 0, WHT_RGB_Display_Driver.WHT_Info->X_Length - 1, WHT_RGB_Display_Driver.WHT_Info->Y_Length - 1, RGB565_BLUE);
    WHT_RGB_Display_Driver.WHT_Set_Transparency(250);

    while(1)
    {
        WHT_RGB_Display_Driver.WHT_Fill_Color(50, 50, 900, 500, RGB565_RED);
        vTaskDelay(500);
        
        WHT_RGB_Display_Driver.WHT_Fill_Color(75, 75, 850, 525, RGB565_GREEN);
        vTaskDelay(500);

        WHT_RGB_Display_Driver.WHT_Fill_Color(100, 100, 800, 550, RGB565_BLUE);
        vTaskDelay(500);

        
        WHT_RGB_Display_Driver.WHT_Info->Font = (WHT_Font_Info_t*)&Font_ASCII_12x24;
        WHT_RGB_Display_Driver.WHT_Puts("hello word! for 7' LCD  Font 12 * 24\r\n");
        vTaskDelay(500);

        WHT_RGB_Display_Driver.WHT_Info->Font = (WHT_Font_Info_t*)&Font_ASCII_8x16;
        WHT_RGB_Display_Driver.WHT_Puts("hello word! for 7' LCD  Font 8 * 16\r\n");
        vTaskDelay(500);

        WHT_RGB_Display_Driver.WHT_Info->Font = (WHT_Font_Info_t*)&Font_ASCII_12x24;
        WHT_RGB_Display_Driver.WHT_Puts("hello word! My Name Is WHT\r\n");
        vTaskDelay(500);
        break;
    }
}
